<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{userPayAction}" />
	
	<span class="pagetitle">付费分析 —— 新玩家价值</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
        <p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd" />
		-
		<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd" />
		&#160;&#160;&#160;
		
		<p:selectOneMenu id="platformSel" styleClass="queryPlatform" value="#{bean.queryPlatform}">
	        <f:selectItems value="#{bean.platformItmes}" />
	        <p:ajax update="channelSel serverSel" listener="#{bean.updateChannelItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="channelSel" styleClass="queryChannel" value="#{bean.queryChannel}">
	        <f:selectItems value="#{bean.channelItmes}" />
	        <p:ajax update="serverSel platformSel" listener="#{bean.updateServerItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="serverSel" styleClass="queryServer" value="#{bean.queryServer}">
	         <f:selectItems value="#{bean.serverItmes}" />
	         <p:ajax update="channelSel platformSel" listener="#{bean.selectedServer}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
		
        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
	</h:form>
	<br />

	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<h:panelGrid columns="1" style="width:100%">
             <div id="basewidth" style="width:94%;height:0; border:0;" />
        </h:panelGrid>
         <h:panelGrid columns="1" style="width:100%">
             <div id="basewidth2" style="width:91%;height:0; border:0;" />
        </h:panelGrid>
        
		<div class="data" id="data">
		
		<!--  
			<p:panel id="panel0" header="新玩家价值总体数据" style="margin-bottom:10px;">
				<p:dataGrid id="chart00" var="c" value="#{bean.userPayChart}" columns="1" layout="grid">
			        <p:panel style="text-align:center">
			            <h:panelGrid columns="1" style="width:100%">
			                <div id="highchartChart0" style="width:100%;height:400px; border:0;">
								<script type="text/javascript">
									generateChart('#{c.jsonStr}', '#{c.jsonType}', '0', 'basewidth');
								</script>  
							</div>
			            </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>
			    <br />
			
				<h:commandLink>
		        	<p:graphicImage url="/resources/images/excel.png" height="25px"/>
		       		<p:dataExporter type="xls" target="dlist1" fileName="userPayData-#{pageHelper.getNewDateDetailStr()}" />
			    </h:commandLink>
				<p:dataTable id="dlist1" value="#{bean}" scrollable="true" resizableColumns="true" paginator="false" style="text-align:center;">
					<p:columns value="#{bean.userPayData}" var="c" columnIndexVar="i" style="text-align:center;">
						<f:facet name="header">#{c.name}</f:facet>
						<h:outputLabel value="#{c.ltv}" />
					</p:columns>
				</p:dataTable>
			</p:panel>
					
			<br />
			<p:separator />
			-->
			<p:accordionPanel>
		        <p:tab title="新玩家价值">
		            <p:dataGrid id="chart1" var="c" value="#{bean.userPayValueChart}" columns="1" scrollable="true" resizableColumns="true" paginator="false" layout="grid">
				        <p:panel style="text-align:center">
				            <h:panelGrid columns="1" style="width:100%">
				                <div id="highchartChart1" style="width:100%;height:400px; border:0;">
									<script type="text/javascript">
										generateChart('#{c.jsonStr}', '#{c.jsonType}', '1', 'basewidth');
									</script>  
								</div>
				            </h:panelGrid>
				        </p:panel>
				    </p:dataGrid>
				    
				    <br />
				    <p:dataTable id="dlist2" var="l" value="#{bean.userPayValueData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
						<f:facet name="{Exporters}">
				        	<h:commandLink styleClass="exporter">
						        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
						        <p:dataExporter type="xls" target="dlist2" fileName="userPayValueData-#{pageHelper.getNewDateDetailStr()}"/>
						    </h:commandLink>
					    </f:facet>
						
						<p:column headerText="日期" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.dateStr}" />
						</p:column>
						<p:column headerText="1日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the1ltv}" />
						</p:column>
						<p:column headerText="2日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the2ltv}" />
						</p:column>
						<p:column headerText="3日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the3ltv}" />
						</p:column>
						<p:column headerText="4日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the4ltv}" />
						</p:column>
						<p:column headerText="5日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the5ltv}" />
						</p:column>
						<p:column headerText="6日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the6ltv}" />
						</p:column>
						<p:column headerText="7日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the7ltv}" />
						</p:column>
						<p:column headerText="10日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the10ltv}" />
						</p:column>
						<p:column headerText="12日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the12ltv}" />
						</p:column>
						<p:column headerText="14日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the14ltv}" />
						</p:column>
						<p:column headerText="21日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the21ltv}" />
						</p:column>
						<p:column headerText="28日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the28ltv}" />
						</p:column>
						<p:column headerText="30日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the30ltv}" />
						</p:column>
						<p:column headerText="60日LTV" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.the60ltv}" />
						</p:column>
					</p:dataTable>
		        </p:tab>
		        
		        <p:tab title="新玩家价值对比">
		        	<p:tabView>
			    		<p:ajax event="tabChange" listener="#{bean.onCompareTabChange}" update="chart21 dlist21 chart22 dlist22 chart23 dlist23"/>
				        <p:tab title="平台对比" id="platform1">
				        	<p:dataGrid id="chart21" var="c" value="#{bean.userPayCompareChart}" columns="1" layout="grid">
						        <p:panel style="text-align:center">
						            <h:panelGrid columns="2" style="width:100%">
						                <div id="highchartChart2" style="width:100%;height:400px; border:0;">
											<script type="text/javascript">
												generateChart('#{c.jsonStr}', '#{c.jsonType}', '2', 'basewidth2');
											</script>  
										</div>
						            </h:panelGrid>
						        </p:panel>
						    </p:dataGrid>
						    
						    <br />
						    <p:dataTable id="dlist21" var="l" value="#{bean.userPayCompareData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
								<f:facet name="{Exporters}">
						        	<h:commandLink styleClass="exporter">
								        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
								        <p:dataExporter type="xls" target="dlist21" fileName="platformUserPayCompareData-#{pageHelper.getNewDateDetailStr()}"/>
								    </h:commandLink>
							    </f:facet>
								
								<p:column headerText="分类" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.classStr}" />
								</p:column>
								<p:column headerText="1日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the1ltv}" />
								</p:column>
								<p:column headerText="2日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the2ltv}" />
								</p:column>
								<p:column headerText="3日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the3ltv}" />
								</p:column>
								<p:column headerText="4日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the4ltv}" />
								</p:column>
								<p:column headerText="5日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the5ltv}" />
								</p:column>
								<p:column headerText="6日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the6ltv}" />
								</p:column>
								<p:column headerText="7日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the7ltv}" />
								</p:column>
								<p:column headerText="10日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the10ltv}" />
								</p:column>
								<p:column headerText="12日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the12ltv}" />
								</p:column>
								<p:column headerText="14日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the14ltv}" />
								</p:column>
								<p:column headerText="21日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the21ltv}" />
								</p:column>
								<p:column headerText="28日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the28ltv}" />
								</p:column>
								<p:column headerText="30日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the30ltv}" />
								</p:column>
								<p:column headerText="60日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the60ltv}" />
								</p:column>
							</p:dataTable>
				        </p:tab>
				        
				        <p:tab title="渠道对比" id="channel1">
				        	<p:dataGrid id="chart22" var="c" value="#{bean.userPayCompareChart}" columns="1" layout="grid">
						        <p:panel style="text-align:center">
						            <h:panelGrid columns="1" style="width:100%">
						                <div id="highchartChart3" style="width:100%;height:400px; border:0;">
											<script type="text/javascript">
												generateChart('#{c.jsonStr}', '#{c.jsonType}', '3', 'basewidth2');
											</script>  
										</div>
						            </h:panelGrid>
						        </p:panel>
						    </p:dataGrid>
						    
						    <br />
						    <p:dataTable id="dlist22" var="l" value="#{bean.userPayCompareData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
								<f:facet name="{Exporters}">
						        	<h:commandLink styleClass="exporter">
								        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
								        <p:dataExporter type="xls" target="dlist22" fileName="channelUserPayCompareData-#{pageHelper.getNewDateDetailStr()}"/>
								    </h:commandLink>
							    </f:facet>
								
								<p:column headerText="分类" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.classStr}" />
								</p:column>
								<p:column headerText="1日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the1ltv}" />
								</p:column>
								<p:column headerText="2日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the2ltv}" />
								</p:column>
								<p:column headerText="3日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the3ltv}" />
								</p:column>
								<p:column headerText="4日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the4ltv}" />
								</p:column>
								<p:column headerText="5日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the5ltv}" />
								</p:column>
								<p:column headerText="6日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the6ltv}" />
								</p:column>
								<p:column headerText="7日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the7ltv}" />
								</p:column>
								<p:column headerText="10日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the10ltv}" />
								</p:column>
								<p:column headerText="12日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the12ltv}" />
								</p:column>
								<p:column headerText="14日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the14ltv}" />
								</p:column>
								<p:column headerText="21日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the21ltv}" />
								</p:column>
								<p:column headerText="28日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the28ltv}" />
								</p:column>
								<p:column headerText="30日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the30ltv}" />
								</p:column>
								<p:column headerText="60日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the60ltv}" />
								</p:column>
							</p:dataTable>
				        </p:tab>
				        
				        <p:tab title="区服对比" id="server1">
				        	<p:dataGrid id="chart23" var="c" value="#{bean.userPayCompareChart}" columns="1" layout="grid">
						        <p:panel style="text-align:center">
						            <h:panelGrid columns="1" style="width:100%">
						                <div id="highchartChart4" style="width:100%;height:400px; border:0;">
											<script type="text/javascript">
												generateChart('#{c.jsonStr}', '#{c.jsonType}', '4', 'basewidth2');
											</script>  
										</div>
						            </h:panelGrid>
						        </p:panel>
						    </p:dataGrid>
						    
						    <br />
						    <p:dataTable id="dlist23" var="l" value="#{bean.userPayCompareData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
								<f:facet name="{Exporters}">
						        	<h:commandLink styleClass="exporter">
								        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
								        <p:dataExporter type="xls" target="dlist23" fileName="serverUserPayCompareData-#{pageHelper.getNewDateDetailStr()}"/>
								    </h:commandLink>
							    </f:facet>
								
								<p:column headerText="分类" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.classStr}" />
								</p:column>
								<p:column headerText="1日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the1ltv}" />
								</p:column>
								<p:column headerText="2日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the2ltv}" />
								</p:column>
								<p:column headerText="3日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the3ltv}" />
								</p:column>
								<p:column headerText="4日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the4ltv}" />
								</p:column>
								<p:column headerText="5日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the5ltv}" />
								</p:column>
								<p:column headerText="6日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the6ltv}" />
								</p:column>
								<p:column headerText="7日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the7ltv}" />
								</p:column>
								<p:column headerText="10日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the10ltv}" />
								</p:column>
								<p:column headerText="12日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the12ltv}" />
								</p:column>
								<p:column headerText="14日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the14ltv}" />
								</p:column>
								<p:column headerText="21日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the21ltv}" />
								</p:column>
								<p:column headerText="28日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the28ltv}" />
								</p:column>
								<p:column headerText="30日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the30ltv}" />
								</p:column>
								<p:column headerText="60日LTV" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.the60ltv}" />
								</p:column>
							</p:dataTable>
				        </p:tab>
				    </p:tabView>
		        </p:tab>
		    </p:accordionPanel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>